package com.bayihouse.model.excel.publicClass;


import com.baomidou.mybatisplus.annotation.TableField;
import com.bayihouse.model.excel.publicClass.father.BaseEntity;
import com.bayihouse.utils.MyObjectUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public abstract class BaseOneEntity<T> extends BaseEntity {

    @TableField(exist = false)
    protected List<T> tlist;


    protected boolean checkIsEmptyTList() {
        if (super.id == null) {
            return true;
        }
        if (MyObjectUtils.isArraysEmpty(tlist)) {
            return true;
        }
        return false;
    }


    public void initT() {
        tlist = new ArrayList<>();
    }

    protected abstract void setTId();

}
